/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */
#ifndef PLCONNECTIONDATA_H
#define PLCONNECTIONDATA_H

#include <kernel/PLGlobal.h>
#include <kernel/signalslot/lang/PLSignalTypes.h>

namespace PLSDK {

	class PLConnectionBase;
	class PLSignalBase;

	/**
	 * The connection data for the object.
	 */
	class PLAPI_EXPORT PLConnectionData {
	public:
		/**
		 * Constructor.
		 */
		PLConnectionData() : m_signal(0), m_connection(0) {}
		/**
		 * Destructor.
		 */
		virtual ~PLConnectionData();
		/**
		 * Set the signal for the connection.
		 *
		 * @param signal The signal from the connection.
		 */
		void setSignal(PLSignalBase *signal);
		/**
		 * The signal from the connection.
		 *
		 * @return The signal.
		 */
		PLSignalBase *signal();
		/**
		 * Set the connection.
		 *
		 * @param connection The connection to set.
		 */
		void setConnection(PLConnectionBase *connection);
		/**
		 * The connection of the connection.
		 *
		 * @return The connection.
		 */
		PLConnectionBase *connection();
		/**
		 * Set the signal type.
		 *
		 * @param type The type to set.
		 */
		inline void setSignalType(PLSignalTypes type);
		/**
		 * The signal type.
		 *
		 * @return The signal type.
		 */
		inline PLSignalTypes signalType();
	private:
		PLSignalBase *m_signal;
		PLConnectionBase *m_connection;
		PLSignalTypes m_type;
	};

	void PLConnectionData::setSignalType(PLSignalTypes type) {
		m_type = type;
	}

	PLSignalTypes PLConnectionData::signalType() {
		return m_type;
	}

}

#endif
